-
Notifications
You must be signed in to change notification settings - Fork 184
Add support for the Filecoin.EthTraceFilter V2 #6522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds a v2 RPC endpoint Filecoin.EthTraceFilter (EthTraceFilterV2) that mirrors v1 semantics but uses the v2 tipset/block resolver; registers the new method and adds a corresponding test case and snapshot entry. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant RPC as RpcServer / EthTraceFilterV2
participant Resolver as TipsetResolverV2
participant DB as Blockstore
participant Trace as TraceFilterLogic
Client->>RPC: Call Filecoin.EthTraceFilter (filter)
RPC->>Resolver: resolve fromBlock/toBlock (tipset_by_block_number_or_hash_v2)
Resolver->>DB: fetch tipset by number or hash
DB-->>Resolver: tipset (epoch)
Resolver-->>RPC: resolved epochs
RPC->>Trace: invoke trace_filter with resolved epochs
Trace-->>RPC: traces (sorted)
RPC-->>Client: return Vec<EthBlockTrace>
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 52: Update the CHANGELOG.md entry that currently references PR `#6522` to
reference issue `#6307` instead; replace the PR link
"[`#6522`](https://github.com/ChainSafe/forest/pull/6522): Implemented
`Filecoin.EthTraceFilter` for API v2." with the issue-style entry
"[`#6307`](https://github.com/ChainSafe/forest/issues/6307): Implemented
`Filecoin.EthTraceFilter` for API v2." so the changelog points to the issue
rather than the PR.
In `@src/rpc/methods/eth.rs`:
- Around line 4144-4189: The public enum EthTraceFilterV2 lacks rustdoc; add a
concise triple-slash doc comment above pub enum EthTraceFilterV2 describing its
purpose (RPC method Filecoin.EthTraceFilter / alias "trace_filter"), expected
parameter (EthTraceFilterCriteria), return type (Vec<EthBlockTrace>), and a
brief note about behavior (returns traces for transactions matching the filter
between from_block and to_block as handled in impl RpcMethod for
EthTraceFilterV2), so readers of the type and generated docs immediately
understand what this RPC endpoint represents and how it is used.
hanabi1224
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the changelog entry to the new unreleased section
Summary of changes
Changes introduced in this pull request:
Filecoin.EthTraceFilterV2 and added test.Reference issue to close (if applicable)
Closes #6307
Other information and links
Change checklist
Outside contributions
Summary by CodeRabbit
New Features
Tests
Changelog
Snapshots